package pc29;

import java.util.Scanner;

public class J09Number {
	public static void main(String[] args) {

		int a;
		int b;

		int j[] = new int[6];
		int l[] = new int[7];

		Scanner sc = new Scanner(System.in);

		System.out.println("주민번호 입력해봐");
		a = sc.nextInt();
		System.out.println("주민번호 입력해봐");
		b = sc.nextInt();

		j[0] = a / (100000);
		j[1] = (a - (j[0] * 100000)) / 10000;
		j[2] = (a - (j[0] * 100000) - (j[1] * 10000)) / 1000;
		j[3] = (a - (j[0] * 100000) - (j[1] * 10000) - (j[2] * 1000)) / 100;
		j[4] = (a - (j[0] * 100000) - (j[1] * 10000) - (j[2] * 1000) - (j[3] * 100)) / 10;
		j[5] = (a - (j[0] * 100000) - (j[1] * 10000) - (j[2] * 1000)
				- (j[3] * 100) - j[4] * 10);

		l[0] = a / (1000000);
		l[1] = (a - (l[0] * 1000000)) / 100000;
		l[2] = (a - (l[0] * 1000000) - (l[1] * 100000)) / 10000;
		l[3] = (a - (l[0] * 1000000) - (l[1] * 100000) - (l[2] * 10000)) / 1000;
		l[4] = (a - (l[0] * 1000000) - (l[1] * 100000) - (l[2] * 10000) - (l[3] * 1000)) / 100;
		l[5] = (a - (l[0] * 1000000) - (l[1] * 100000) - (l[2] * 10000)
				- (l[3] * 1000) - l[4] * 100) / 10;
		l[6] = (a - (l[0] * 1000000) - (l[1] * 100000) - (l[2] * 10000)
				- (l[3] * 1000) - l[4] * 100)
				- (l[5] * 10);

		j[0] *= 2;
		j[1] *= 3;
		j[2] *= 4;
		j[3] *= 5;
		j[4] *= 6;
		j[5] *= 7;
		l[0] *= 8;
		l[1] *= 9;
		l[2] *= 2;
		l[3] *= 3;
		l[4] *= 4;
		l[5] *= 5;
		l[6] *= 6;
		
		int sum=0;
		for(int k =0; k<=5; k++){
			sum+=j[k];
		}
		
		int sum1=0;
		for(int k=0; k<=6; k++){
			sum1+=l[k];
		}
		
		
		sum = (sum + sum1) % 11;
		
		sum = 11 - sum;
		
		if(sum != l[6])
			System.out.println("유효주민번호다");

	}
}
